//
//  DataUser.m
//  DoubanDemo1
//
//  Created by lanou3g on 15/11/21.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "DataUser.h"

@interface DataUser ()
@property (nonatomic,strong) NSMutableDictionary *userDic;

@end
static DataUser *dataUser = nil;
@implementation DataUser

+ (DataUser *)sharedInstance
{
    
    if (dataUser == nil) {
        dataUser = [[DataUser alloc] init];
        dataUser.userDic = [NSMutableDictionary dictionary];
        dataUser.haveUser = NO;
    }
    return dataUser;
}
#pragma mark - 添加用户信息
- (void)adduserName:(NSString *)userText passWord:(NSString *)passwordText
{
    [self.userDic setObject:passwordText forKey:userText];
}
#pragma mark - 登陆是判断账号密码是否正确
- (BOOL)whetherInformationCorrectOfUserName:(NSString *)uesrText passWord:(NSString *)passwordText
{
    NSString *str = [self.userDic valueForKey:uesrText];
    if ([str isEqualToString:passwordText]) {
        return YES;
    }
    return NO;
}
#pragma mark - 改变用户状态
- (void)chanageUserState
{
    if (dataUser.haveUser == YES) {
        dataUser.haveUser = NO;
    }else{
        dataUser.haveUser = YES;
    }
}



@end
